package cn.wolfcode.wolf2w.job.task;

import cn.wolfcode.wolf2w.business.api.RemoteNoteService;
import cn.wolfcode.wolf2w.business.api.RemoteStrategyService;
import cn.wolfcode.wolf2w.common.core.constant.SecurityConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component("travelTask")
public class TravelTask {
    @Autowired
    private RemoteStrategyService remoteStrategyService;
    @Autowired
    private RemoteNoteService remoteNoteService;

    public void test() {
        String time = new Date().toLocaleString();
        System.out.println(time);
    }

    public void startStrategyRank(){
        remoteStrategyService.statisRank(SecurityConstants.INNER);
//        这行代码的作用是通过 remoteStrategyService 调用 statisRank 方法，执行统计排名逻辑，
//        并指定调用类型为内部调用（INNER）。这种设计常见于需要区分调用来源（如内部系统调用或外部请求）的场景。

        //这个代码和上面代码作用一致
//        remoteStrategyService.statisRank("inner");
    }




    public void startStrategyCondition(){
        remoteStrategyService.statisCondition(SecurityConstants.INNER);

//        remoteStrategyService.startStrategyCondition(SecurityConstants.INNER);
    }



    //数据持久化
    public void strategyStatisHashPersistence(){
        remoteStrategyService.strategyStatisHashPersistence(SecurityConstants.INNER);
    }


    //游记点赞统计
    public void setRemoteStrategyService(){
        remoteNoteService.noteStar(SecurityConstants.INNER);
    }



}
